<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/main.css">
    <title>公告</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/bootstrap-3.4.1-dist/css/bootstrap.css">
    <script src="${pageContext.request.contextPath}/static/bootstrap-3.4.1-dist/js/bootstrap.js"></script>
</head>
<body>
<c:if test="${empty user}">
    <div class="top-nav">
        <div class="container clearf">
            <div class="left">
                <a href="${pageContext.request.contextPath}/Index.jsp" class="item">首页</a>
            </div>

            <div class="right">
                <a href="${pageContext.request.contextPath}/Register.jsp" class="item">注册/登录</a>
            </div>
        </div>
    </div>
</c:if>

<c:if test="${not empty user}">
    <div class="top-nav">
        <div class="container clearf">
            <div class="left">
                <a href="${pageContext.request.contextPath}/UserServlet?action=BackToIndex&id=${user.id}" class="item">首页</a>
            </div>

            <div class="right">
                <div class="dropdown item">
                    <a class="item">欢迎您，${user.username}</a>
                    <div class="dropdown-content">
                        <a href="${pageContext.request.contextPath}/UserServlet?action=UserInf&id=${user.id}">个人信息</a>
                        <a href="#">我的订单</a>
                        <a href="${pageContext.request.contextPath}/CartServlet?action=IntoCart&id=${user.id}">我的购物车</a>
                        <a href="${pageContext.request.contextPath}/CollectionServlet?action=IntoCollection&id=${user.id}">我的收藏夹</a>
                        <a href="${pageContext.request.contextPath}/UserServlet?action=LogOut">退出登录</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</c:if>

<div class="header">
    <div class="container clearf">
        <div class="col-1 logo">公告</div><br>
        <div align="center"><h1>【公告】${notice.title}</h1></div><br>
        <div style="padding-left: 100px;font-size: 30px">${notice.msg}</div>
    </div>
    <br>
    <div style="float: right;padding-right: 100px">发布人:${notice.username}</div>
    <br>
    <div style="float: right;padding-right: 100px">发布时间:${notice.pubtime}</div>
</div>
<br>
<c:if test="${not empty user}">
    <div style="text-align: center"><a class="btn btn-default" href="${pageContext.request.contextPath}/NoticeServlet?action=BackToIndex&uid=${user.id}" role="button">返回</a></div>
</c:if>



</body>
</html>
